package base.template;

import java.util.ArrayList;
import java.util.Collection;

import base.template.coffee.Coffee;

public class Generators {
	public static <E> Collection<E> fill(Collection<E> coll,Generator<E> gen,int n){
		for(int i=0;i<n;i++){
			coll.add(gen.next());
		}
		return coll;
	}
	public static void main(String[] args) {
		Collection<Coffee> coffees=fill(new ArrayList<Coffee>(), new CoffeeGenerator(), 3);
		for(Coffee c:coffees){
			System.out.println(c);
		}
	}
}
